import { useState } from 'react'

/**
 * 弹窗的开启关闭逻辑
 * @returns 
 */
const ModalFunc = () => {

    const [ visible, setVisible ] = useState(false)

    // 开启弹窗
    function open() {
        setVisible(true)
    }

    // 关闭弹窗
    function close() {
        setVisible(false)
    }

    return ({
        visible,
        open,
        close
    })
}

export default ModalFunc